ShaderEx V1.0

ShaderEx is a Quake 3 bsp post processing tool. It inserts customized surfaceparms into the bsp file.

Usage: shaderex (bsp path) (shaderex config path)

(bsp path) is either an absolute or relative path to the bsp file
(shaderex config path) is either an absolute or relative path to a text file that is used
to configure shaderex.

The configuration text file must meet strict guidelines (shaderex V1.0 is not dummy proof)
There should be absolutely no stray spaces or tabs in the file.
Every line should end with a newline. (Press enter on every line you put in the text file)
On the first line you must have the absolute path to the Quake 3 directory.
On the following lines (up to 14 lines) you can put one word that is your custom surfaceparm.
Note the actual value mapped to the surfaceparm is dependeant upon the line it is on in the text file.

Under normal circumstances, Quake 3 does not use the upper 14 bits of the surface flags.
So the first custom surfaceparm gets mapped to 0x40000
The next to 0x80000 and so on.
You do not need all 14 surfaceparm lines.

To prevent Quake 3 and the Quake 3 tools from spitting out errors when processing the shaders, the customized surfaceparms are placed into the shader definition within a special comment //$

This program does not read shader files that are in pk3 files, so each shader file must be in a scripts directory. The program does look in all available scripts directories for shader files.

For example, here is a typical config file I might use:
C:\Program Files\Quake III Arena
reflects
dampens
sticky
gravel
asphalt
dirt
grass

And in the shader definitions I may have the following
textures/mymod/stickystuff/goo
{
	qer_editorimage textures/mymod/stickystuff/blue_goo.tga
	surfaceparm nomarks
	//$ sticky
	{
		map textures/mymod/stickystuff/squirmies.tga
		tcMod turb 5 5 1 0.5
		
	}
	{
		map textures/mymod/stickystuff/blue_goo.tga
		blendfunc gl_one gl_one
	}
}

and so on and so forth...

In surfaceflags.h I would have defined my custom surfaceflags:

#define SURFACEFLAG_REFLECTS	0x40000
#define SURFACEFLAG_DAMPENS	0x80000
#define SURFACEFLAG_STICKY	0x100000
#define SURFACEFLAG_GRAVEL	0x200000
#define SURFACEFLAG_ASPHALT	0x400000
#define SURFACEFLAG_DIRT	0x800000
#define SURFACEFLAG_GRASS	0x1000000

and I might use the following command line (assuming I have placed shaderex in my Q3 tools directory)
shaderex ../mymod/maps/candylane.bsp mymodparms.txt

Note: this program has not been thoroughly tested, (I've only used it once in fact :p)
-Mastaba

(c) 2000 David Frey a.k.a Mastaba

